Matthias Clasen [Tue, 12 May 2020 21:17:29 +0000 (21:17 +0000)]
Merge branch 'tests-cleanup' into 'master'
Tests cleanup
See merge request GNOME/gtk!1884
Matthias Clasen [Tue, 12 May 2020 19:56:46 +0000 (15:56 -0400)]
tests: Drop the visuals test
This was just a different way to load a ui file
and try it with dark mode. This can be done
with gtk-builder-tool preview and GTK_THEME.
Matthias Clasen [Tue, 12 May 2020 19:42:37 +0000 (15:42 -0400)]
tests: Move testcairo into gtk4-demo
Replace the boring checkboard pattern with this
exciting drawing, and save one test binary at the
same time!
Matthias Clasen [Tue, 12 May 2020 19:29:55 +0000 (15:29 -0400)]
Drop the gtkgears test
This has recently been moved to gtk4-demo.
No need to duplicate it.
Matthias Clasen [Tue, 12 May 2020 19:28:34 +0000 (15:28 -0400)]
Move print-editor to demos
It is too demo-esque for languishing in tests/.
Matthias Clasen [Tue, 12 May 2020 19:12:17 +0000 (15:12 -0400)]
NEWS: Updates
Matthias Clasen [Tue, 12 May 2020 18:54:59 +0000 (18:54 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
printoperation-unix: Fix a use-after-free
See merge request GNOME/gtk!1883
Emmanuele Bassi [Tue, 12 May 2020 18:40:34 +0000 (18:40 +0000)]
Merge branch 'docs-fixes' into 'master'
Docs fixes
See merge request GNOME/gtk!1882
Matthias Clasen [Tue, 12 May 2020 18:09:51 +0000 (14:09 -0400)]
printoperation-unix: Fix a use-after-free
It turns out that finish_print destroys the
PrintResponseData, so we can't access it afterwards.
Emmanuele Bassi [Tue, 12 May 2020 17:52:45 +0000 (18:52 +0100)]
docs: Add annotations for GtkPaned new getters
Which means also adding gtk-doc stanzas.
Emmanuele Bassi [Tue, 12 May 2020 17:44:21 +0000 (18:44 +0100)]
docs: Remove unnecessary SECTION
The GdkDragSurface definitions fall under the "dnd" section.
Emmanuele Bassi [Tue, 12 May 2020 17:43:56 +0000 (18:43 +0100)]
docs: Remove redundant SECTION
We already have a SECTION stanza for gtk-doc.
Carlos Garnacho [Tue, 12 May 2020 16:14:47 +0000 (16:14 +0000)]
Merge branch 'wip/carlosg/broken-grabs' into 'master'
Fixes to broken grabs
Closes #2665
See merge request GNOME/gtk!1879
Matthias Clasen [Tue, 12 May 2020 15:58:10 +0000 (15:58 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
window: Hide windows on destroy
See merge request GNOME/gtk!1881
Carlos Garnacho [Tue, 12 May 2020 08:41:54 +0000 (10:41 +0200)]
gtkmain: Release the active state on GDK_GRAB_BROKEN
This is handled internally here, but misses broken grabs. The active
state should be dropped just as if the button were released.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2665
Matthias Clasen [Tue, 12 May 2020 15:10:36 +0000 (11:10 -0400)]
window: Hide windows on destroy
I thought I could get away with just unrealizing the
window, but it turns out that gtk_window_hide() is the
place where we remove grabs when a modal dialog goes
away, so we ended up with stuck grabs.
Matthias Clasen [Tue, 12 May 2020 14:52:01 +0000 (14:52 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Documentation work
See merge request GNOME/gtk!1880
Matthias Clasen [Tue, 12 May 2020 14:29:54 +0000 (14:29 +0000)]
Merge branch 'ebassi/run-dialog-run' into 'master'
Remove gtk_dialog_run() and friends
Closes #371
See merge request GNOME/gtk!1801
Emmanuele Bassi [Fri, 1 May 2020 10:08:41 +0000 (11:08 +0100)]
Do not release the GFile prematurely
Otherwise we won't be able to access it to get the URI for the
GtkPrinterOption.
This fixes a regression introduced in commit
5f070ff2333.
Emmanuele Bassi [Thu, 30 Apr 2020 15:08:37 +0000 (16:08 +0100)]
docs: Mention blocking functions in the migration guide
Link to how to make a dialog modal, and to the response signal.
Emmanuele Bassi [Thu, 30 Apr 2020 17:53:02 +0000 (18:53 +0100)]
Remove gtk_dialog_run()
Nested main loops are bad, as they introduce layers of complexity caused
by the potential re-entrancy in the case of multiple event sources, like
IPC, threads, etc. Additionally, the programming model they provide—stop
the world while spinning a new loop—does not conform to the event-driven
model employed by GTK.
Emmanuele Bassi [Thu, 30 Apr 2020 17:45:01 +0000 (18:45 +0100)]
Remove gtk_dialog_run() from GtkPrintUnixDialog
Replace it with an explicit nested main loop, as we need to block the
signal handler currently being emitted depending on the response of the
overwrite confirmation dialog.
This is a bit of a hack, and the only reason we need it is that the
print dialog will load the last used path as the output file name, when
printing to a file; this means that, in theory, it would be possible to
press Print without selecting a file, and accidentally overwriting an
existing file.
It would be much simpler if we did not store the last used path, and
always explicitly asked the user to select a file; this would avoid
destructive actions, and would allow us to rely on the overwrite
confirmation dialog right inside the file chooser.
Emmanuele Bassi [Thu, 30 Apr 2020 16:24:15 +0000 (17:24 +0100)]
Remove unnecessary deprecation pragmas
The gtk_window_present() function is not deprecated.
Emmanuele Bassi [Thu, 30 Apr 2020 15:28:00 +0000 (16:28 +0100)]
Drop gtk_dialog_run() from GtkPrintOperationUnix
We still provide a blocking API, but we should strongly reconsider it.
Emmanuele Bassi [Thu, 30 Apr 2020 14:32:38 +0000 (15:32 +0100)]
tests: Remove gtk_dialog_run()
Either use the "response" signal for dialogs that are already modal, or
use an explicit nested loop for tests that rely on the response id being
available in sequence.
Emmanuele Bassi [Thu, 30 Apr 2020 13:41:57 +0000 (14:41 +0100)]
Drop gtk_dialog_run() from GtkFileChooserWidget
The various dialogs we use inside the file chooser are modal already,
and do no need a nested loop.
Emmanuele Bassi [Thu, 30 Apr 2020 13:05:23 +0000 (14:05 +0100)]
docs: Remove use of gtk_dialog_run()
Direct people to use GTK_DIALOG_MODAL and the "response" signal instead
of nested main loops.
Emmanuele Bassi [Thu, 30 Apr 2020 12:56:41 +0000 (13:56 +0100)]
Remove gtk_native_dialog_run()
Nested main loops are bad, as they introduce layers of complexity caused
by the potential re-entrancy in the case of multiple event sources, like
IPC, threads, etc. Additionally, the programming model they provide—stop
the world while spinning a new loop—does not conform to the event-driven
model employed by GTK.
Emmanuele Bassi [Thu, 30 Apr 2020 12:51:44 +0000 (13:51 +0100)]
docs: Remove use of gtk_native_dialog_run() from examples
Use the "response" signal instead.
Emmanuele Bassi [Thu, 30 Apr 2020 12:43:17 +0000 (13:43 +0100)]
Remove gtk_dialog_run() from GtkMountOperation
Carlos Garnacho [Tue, 12 May 2020 08:36:18 +0000 (10:36 +0200)]
gtkmain: Propagate GDK_GRAB_BROKEN events to/from current focus
Let keyboard/pointer paths handle their own events, and find the
current focus. The event will be propagated through instead of
being just emitted on the toplevel.
This makes it handled throughout all the gestures that want to
know about it.
Carlos Garnacho [Tue, 12 May 2020 08:24:36 +0000 (10:24 +0200)]
gdk/wayland: Drop explicit ungrab after surface move/resize
We now break grabs properly if receiving a .leave event with
active buttons. This is not necessary anymore.
Carlos Garnacho [Tue, 12 May 2020 08:21:35 +0000 (10:21 +0200)]
gdk/wayland: Ensure .leave events with active buttons breaks grabs
Instead of silently ending up the grab, make it sure that we emit
a GDK_GRAB_BROKEN event if needed.
Carlos Garnacho [Tue, 12 May 2020 08:19:47 +0000 (10:19 +0200)]
gdk/wayland: Keep track of implicit grabs
Tracking of those broke sometime along the gdk cleanups, so we
started missing some GDK_GRAB_BROKEN events from being emitted
(eg. after a button press/implicit grab triggers an active grab).
Implicit grabs are only added if there's no prior grab (either
implicit through other button presses, or explicit), in order to
keep accounting correct, make those prevail.
Carlos Garnacho [Sat, 25 Apr 2020 00:56:38 +0000 (02:56 +0200)]
gtktexthandle: Set css name on GtkWidgetClass
Handles are their own widget, special names are not necessary
anymore.
Emmanuele Bassi [Thu, 30 Apr 2020 12:30:51 +0000 (13:30 +0100)]
demos: Remove gtk_dialog_run()
Use modal dialogs and the "response" signal.
Matthias Clasen [Tue, 12 May 2020 11:49:07 +0000 (07:49 -0400)]
docs: Updates to the migration guide
Remove some duplicated content, reorder things
to make more sense, and tweak the wording.
Matthias Clasen [Tue, 12 May 2020 05:03:59 +0000 (01:03 -0400)]
docs: Tweaks
Replace some occurrences of GTK+ by GTK.
Matthias Clasen [Tue, 12 May 2020 05:03:34 +0000 (01:03 -0400)]
docs: Updates to the common questions
Refresh the answers to some common questions.
Matthias Clasen [Tue, 12 May 2020 05:02:49 +0000 (01:02 -0400)]
docs: Don't point at mailing lists
Replace references to the mailing lists by
discourse + irc.
Matthias Clasen [Tue, 12 May 2020 05:02:07 +0000 (01:02 -0400)]
docs: Rearrange the introduction some more
Fine-tune some wording, and move the Custom Drawing
example earlier.
Matthias Clasen [Tue, 12 May 2020 03:14:26 +0000 (03:14 +0000)]
Merge branch 'kill-containers' into 'master'
Kill containers
See merge request GNOME/gtk!1866
Matthias Clasen [Sun, 10 May 2020 02:24:00 +0000 (22:24 -0400)]
docs: Update migration guide
Add sections about GtkBin, GtkContainer and gtk_widget_destroy().
Matthias Clasen [Sat, 9 May 2020 03:56:52 +0000 (23:56 -0400)]
dialog: Firm up handling of action widgets
It is unreliable to use the widget dom api to locate
action widgets. For example in a headerbar, they might
be deeper in the hierarchy, with boxes in between.
Therefore, make GtkDialog keep a list of action widgets,
and use that when operating on action widgets.
Matthias Clasen [Sat, 9 May 2020 03:30:25 +0000 (23:30 -0400)]
dialog: Remove an unused struct
Matthias Clasen [Sat, 9 May 2020 01:27:13 +0000 (21:27 -0400)]
Drop GtkContainer and its accessible implementation
It is no longer used.
Matthias Clasen [Sat, 9 May 2020 00:06:46 +0000 (20:06 -0400)]
testsuite: Drop a container api use
Matthias Clasen [Sat, 9 May 2020 00:02:55 +0000 (20:02 -0400)]
Drop gtkcontainer.h includes
These includes are unused.
Matthias Clasen [Fri, 8 May 2020 19:31:02 +0000 (15:31 -0400)]
box: Derive from GtkWidget
Matthias Clasen [Fri, 8 May 2020 19:58:57 +0000 (15:58 -0400)]
assistant: Remove code that doesn't work anymore
When GtkContainer goes away, we don't have
an "add" signal anymore.
Matthias Clasen [Fri, 8 May 2020 19:31:19 +0000 (15:31 -0400)]
dialog: Remove code that doesn't work anymore
When GtkContainer goes away, we don't have an
"add" signal anymore.
Matthias Clasen [Fri, 8 May 2020 19:45:36 +0000 (15:45 -0400)]
shortcutssection: Drop container bits
When GtkBox stops being a container, GtkShortcutsSection
will also no longer be a container. So, stop overriding
container vfuncs, and instead add a buildable implementation
that does the right thing.
Matthias Clasen [Sat, 9 May 2020 01:08:20 +0000 (21:08 -0400)]
shortcutsgroup: Drop container bits
When GtkBox stops being a container, GtkShortcutsGroup
will also no longer be a container. So, stop overriding
container vfuncs, and instead add a buildable implementation
that does the right thing.
Matthias Clasen [Sat, 9 May 2020 12:26:52 +0000 (08:26 -0400)]
Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
Matthias Clasen [Fri, 8 May 2020 16:21:30 +0000 (12:21 -0400)]
box: Add gtk_box_append/prepend/remove
Add replacement api for gtk_container_add/remove.
Matthias Clasen [Fri, 8 May 2020 15:22:16 +0000 (11:22 -0400)]
notebook: Derive from GtkWidget
Matthias Clasen [Fri, 8 May 2020 14:57:21 +0000 (10:57 -0400)]
Stop using container api on GtkNotebook
Matthias Clasen [Fri, 8 May 2020 13:37:52 +0000 (09:37 -0400)]
headerbar: Derive from GtkWidget
Matthias Clasen [Fri, 8 May 2020 13:26:11 +0000 (09:26 -0400)]
Stop using container api on GtkHeaderBar
Matthias Clasen [Fri, 8 May 2020 13:19:21 +0000 (09:19 -0400)]
headerbar: Add gtk_header_bar_remove
This is a replacement for gtk_container_remove.
Matthias Clasen [Fri, 8 May 2020 12:48:00 +0000 (08:48 -0400)]
listbox: Derive from GtkWidget
Matthias Clasen [Sat, 9 May 2020 03:03:53 +0000 (23:03 -0400)]
testsuite: Fix listbox tests
When moving from gtk_container_forall to the widget dom
api, we are now iterating over all children of the listbox,
including headers, separators, etc. So, skip everything
that is not a listboxrow, to make the tests work again.
Matthias Clasen [Sat, 9 May 2020 02:39:51 +0000 (22:39 -0400)]
testsuite: Redo listbox sort test
This test was relying on gtk_container_forall returning
the visual (ie sorted) order of children, while iterating
with the widget dom api gives the insertion order.
Instead of using gtk_container_forall, use
gtk_list_box_row_get_index to reconstruct the visual
order.
Matthias Clasen [Fri, 8 May 2020 06:19:18 +0000 (02:19 -0400)]
Don't use container api on GtkListBox
Matthias Clasen [Fri, 8 May 2020 05:50:37 +0000 (01:50 -0400)]
listbox: Add gtk_list_box_remove
This is a gtk_container_remove replacement.
Matthias Clasen [Fri, 8 May 2020 05:47:19 +0000 (01:47 -0400)]
buildable: Cosmetics
Don't refer to GtkContainer in the docs.
Matthias Clasen [Fri, 8 May 2020 05:44:11 +0000 (01:44 -0400)]
customlayout: Cosmetics
Don't refer to GtkContainer in the docs.
Matthias Clasen [Fri, 8 May 2020 05:05:06 +0000 (01:05 -0400)]
textviewchild: Derive from GtkWidget
GtkContainer is going away.
Matthias Clasen [Fri, 8 May 2020 04:25:47 +0000 (00:25 -0400)]
text: Fix popover use
There were some leftover gtk_container_add calls here
on popovers on buttons, but these are no longer containers.
Matthias Clasen [Fri, 8 May 2020 04:23:44 +0000 (00:23 -0400)]
textview: Fix popover use
There were some leftover gtk_container_add calls here
on popovers on buttons, but these are no longer containers.
Matthias Clasen [Sun, 10 May 2020 01:03:35 +0000 (21:03 -0400)]
flowbox: Derive from GtkWidget
Matthias Clasen [Fri, 8 May 2020 03:24:58 +0000 (23:24 -0400)]
Stop using container api on GtkFlowBox
GtkContainer is going away.
Matthias Clasen [Fri, 8 May 2020 00:24:05 +0000 (20:24 -0400)]
flowbox: Add gtk_flow_box_remove
This is the replacement for gtk_container_remove.
Matthias Clasen [Thu, 7 May 2020 20:04:42 +0000 (16:04 -0400)]
stack: Derive from GtkWidget
Matthias Clasen [Sun, 10 May 2020 01:03:10 +0000 (21:03 -0400)]
treepopover: Stop using container api
Matthias Clasen [Sun, 10 May 2020 01:02:56 +0000 (21:02 -0400)]
shortcutswindow: Stop using container api
Matthias Clasen [Sun, 10 May 2020 01:02:33 +0000 (21:02 -0400)]
shortcutssection: Stop using container api
Matthias Clasen [Sun, 10 May 2020 01:01:24 +0000 (21:01 -0400)]
Don't use container api on GtkStack
Matthias Clasen [Thu, 7 May 2020 19:49:04 +0000 (15:49 -0400)]
stack: Add gtk_stack_remove
This is a replacement for gtk_container_remove.
Matthias Clasen [Thu, 7 May 2020 19:40:20 +0000 (15:40 -0400)]
fixed: Derive from GtkWidget
Matthias Clasen [Thu, 7 May 2020 19:09:28 +0000 (15:09 -0400)]
Stop using container api on GtkFixed
GtkContainer is going away.
Matthias Clasen [Thu, 7 May 2020 19:02:39 +0000 (15:02 -0400)]
fixed: Add gtk_fixed_remove
This is the replacement for gtk_container_reomve.
Matthias Clasen [Thu, 7 May 2020 18:56:37 +0000 (14:56 -0400)]
grid: Derive from GtkWidget
GtkContainer is going away.
Matthias Clasen [Fri, 8 May 2020 16:29:58 +0000 (12:29 -0400)]
grid: Remove a test for grid container functionality
This test was specifically testing how gtk_container_add
behaves on grids. Well, it doesn't anymore.
Matthias Clasen [Thu, 7 May 2020 18:23:36 +0000 (14:23 -0400)]
Avoid container api on grids
GtkContainer is going away.
Matthias Clasen [Thu, 7 May 2020 18:22:12 +0000 (14:22 -0400)]
grid: Add gtk_grid_remove
This is a replacement for gtk_container_remove.
Matthias Clasen [Thu, 7 May 2020 17:00:51 +0000 (13:00 -0400)]
infobar: Derive from GtkWidget
GtkContainer is going away.
Matthias Clasen [Thu, 7 May 2020 16:52:49 +0000 (12:52 -0400)]
Use gtk_info_bar_add_child throughout
Matthias Clasen [Thu, 7 May 2020 16:49:15 +0000 (12:49 -0400)]
infobar: Add gtk_info_bar_add/remove_child
This is a replacement for container api that is going away.
Matthias Clasen [Thu, 7 May 2020 16:28:33 +0000 (12:28 -0400)]
infobar: Add gtk_info_bar_remove_action_widget
This is mainly for completeness, since gtk_container_remove
will not work for those anymore.
Matthias Clasen [Thu, 7 May 2020 12:30:39 +0000 (08:30 -0400)]
paned: Redo the api
This commit is porting GtkPaned to be derived
from GtkWidget instead of GtkContainer, while adding
start-child and end-child properties. The existing
properties are renamed to follow the start/end naming
scheme, and we add proper getters and setters.
Update all users.
See #2719
Matthias Clasen [Thu, 7 May 2020 05:02:01 +0000 (01:02 -0400)]
paned: Drop some dead code
Matthias Clasen [Thu, 7 May 2020 04:47:25 +0000 (00:47 -0400)]
iconview: Derive from GtkWidget
GtkIconView is not a container.
Matthias Clasen [Thu, 7 May 2020 04:16:08 +0000 (00:16 -0400)]
expander: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore. This requires
us to move get_request_mode and compute_expand down.
See #2719
Matthias Clasen [Thu, 7 May 2020 04:05:51 +0000 (00:05 -0400)]
Use gtk_expander_set_child throughout
Replace all uses of gtk_container_add on expanders
with gtk_expander_set_child.
Matthias Clasen [Thu, 7 May 2020 04:02:42 +0000 (00:02 -0400)]
expander: Add a child property
Matthias Clasen [Thu, 7 May 2020 03:54:11 +0000 (23:54 -0400)]
actionbar: Derive from GtkWidget
GtkContainer is going away.
Matthias Clasen [Thu, 7 May 2020 03:42:32 +0000 (23:42 -0400)]
actionbar: Add gtk_action_bar_remove
This is a replacement for gtk_container_remove.
Matthias Clasen [Tue, 5 May 2020 11:27:04 +0000 (07:27 -0400)]
treeview: Derive from GtkWidget
Drop the GtkContainer vfuncs.
Matthias Clasen [Tue, 5 May 2020 02:40:15 +0000 (22:40 -0400)]
treeview: Stop using container api